//
//  BuyCell.swift
//  CompareBuying
//
//  Created by 唐先才 on 16/1/30.
//  Copyright © 2016年 唐先才. All rights reserved.
//

import UIKit

class BuyCell: UITableViewCell {
    
    @IBOutlet weak var iconView: UIImageView!
    @IBOutlet weak var mallLab: UILabel!
    @IBOutlet weak var titleLab: UILabel!
    @IBOutlet weak var priceLab: UILabel!
    @IBOutlet weak var countLab: UILabel!
    var _model: TxcModel?
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
    }

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
    
    func configCellWithModel(model: TxcModel) {
        _model = model
        guard let mainImage = model.MainImage, mallName = model.MallName, infoTime = model.InfoTime, infoTitle = model.InfoTitle, price = model.CommodityPrice, isGood = model.IsGood else {
            return
        }
        iconView.sd_setImageWithURL(NSURL(string: mainImage))
        mallLab.text = mallName + infoTime
        titleLab.text = infoTitle
        priceLab.text = price
        countLab.text = isGood.stringValue
    }

    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
